$(document).ready(function(){
	document.oncontextmenu = function() {return false;};	
});


function previewingrid(url){
	$( "#dialog:ui-dialog" ).dialog( "destroy" );
	
	$( "#dialog:ui-dialog" ).bind( "contextmenu", function(){
		return false;
	});
	var content = $('#input').text();
	var request = $.ajax({
		type : 'GET',
		url : url,
		data : {
			content : content
		},
		dataType : 'html'
	});
	
	request.done(function(msg){
		$( "#dialog-modal" ).html(msg);
	});
	request.fail(function(jqXHR, textStatus) {
		alert("Request failed: " + jqXHR.responseText);
	});
	
	$( "#dialog-modal" ).dialog({
		height: 500,
		modal: true,
		title:'Preview randomly article based on this template!',
		width:500,
		show:'slide'
	});

}
